//package com.ssk.sh.config;
//
//import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
//import javax.sql.DataSource;
//import liquibase.integration.spring.SpringLiquibase;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.autoconfigure.AutoConfigureAfter;
//import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//@AutoConfigureAfter(DynamicDataSourceAutoConfiguration.class)
//public class LiquibaseConfig {
//
//    @Bean
//    @ConfigurationProperties("spring.liquibase.user")
//    public LiquibaseProperties userLiquibaseProperties() {
//        return new LiquibaseProperties();
//    }
//
//    @Bean
//    @ConfigurationProperties("spring.liquibase.chat")
//    public LiquibaseProperties chatLiquibaseProperties() {
//        return new LiquibaseProperties();
//    }
//
//
//    @Bean
//    public SpringLiquibase userLiquibase(@Qualifier("userDyDataSource") DataSource dataSource,
//            @Qualifier("userLiquibaseProperties") LiquibaseProperties properties) {
//        SpringLiquibase liquibase = new SpringLiquibase();
//        liquibase.setDataSource(dataSource);
//        liquibase.setChangeLog(properties.getChangeLog());
//        liquibase.setContexts(String.join(",", properties.getContexts()));
//        liquibase.setDefaultSchema(properties.getDefaultSchema());
//        liquibase.setDropFirst(properties.isDropFirst());
//        liquibase.setShouldRun(properties.isEnabled());
//        return liquibase;
//    }
//
//    @Bean
//    public SpringLiquibase chatLiquibase(@Qualifier("chatDyDataSource") DataSource dataSource,
//            @Qualifier("chatLiquibaseProperties") LiquibaseProperties properties) {
//        SpringLiquibase liquibase = new SpringLiquibase();
//        liquibase.setDataSource(dataSource);
//        liquibase.setChangeLog(properties.getChangeLog());
//        liquibase.setContexts(String.join(",", properties.getContexts()));
//        liquibase.setDefaultSchema(properties.getDefaultSchema());
//        liquibase.setDropFirst(properties.isDropFirst());
//        liquibase.setShouldRun(properties.isEnabled());
//        return liquibase;
//    }
//}